package com.woniu.inlet.web.command;

import com.woniu.inlet.web.fo.UserFo;
import com.woniu.utils.ApplicationContextHolder;

import lombok.Data;

@Data
public class RegisterCommand {

    private UserFo userFo;

    private RegisterCommandHandler handler;

    public RegisterCommand() {
        this.handler = ApplicationContextHolder.getApplicationContext().getBean(RegisterCommandHandler.class);

    }

    public RegisterCommand(UserFo userFo) {
        this();
        this.userFo = userFo;
    }

    public void execute() {
        handler.action(this);
    }
}
